package com.wcfsy.wechat.wx.service.impl;

import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.wcfsy.wechat.wx.entity.ChangeRecordInfo;
import com.wcfsy.wechat.wx.pagination.IPage;
import com.wcfsy.wechat.wx.pagination.impl.Page;
import com.wcfsy.wechat.wx.service.IChangeRecordService;
import com.wcfsy.wechat.wx.sys.dao.ChangeRecordDao;

/**
 */
@Service
public class ChangeRecordServiceImpl implements IChangeRecordService {
	private Logger logger = LoggerFactory
			.getLogger(ChangeRecordServiceImpl.class);

	@Resource
	private ChangeRecordDao changeRecordDao;

	@Override
	public IPage<ChangeRecordInfo> queryChangeRecordByPage(
			Map<String, Object> paramMap, int index, int size) {
		return new Page<ChangeRecordInfo>(
				changeRecordDao.findByParam(paramMap),
				changeRecordDao.count(paramMap), index, size);

	}

	@Override
	public int count(Map<String, Object> paramMap) {
		return changeRecordDao.count(paramMap);
	}

	@Override
	public ChangeRecordInfo getChangeRecordById(int id) {
		return changeRecordDao.getById(id);
	}

}
